import time
o = open('m1_sorted.txt')
s = []
for i in o:
    s.append(int(i))
def spisok(s):
    for i in range(len(s) - 1):
        k = 0
        for j in range(len(s) - 1 - i):
            if s[j] > s[j + 1]:
                s[j], s[j + 1] = s[j + 1], s[j]
                k = k + 1
            if k == 0:
                break
    return s
nach = time.time()
s = spisok(s)
kon = time.time()
print('m1_sorted.txt', round((kon - nach) * 1000), 'millisekond')
o1 = open('m2_reverse.txt')
s = []
for i in o1:
    s.append(int(i))
nach = time.time()
s = spisok(s)
kon = time.time()
print('m2_reverse.txt', round((kon - nach) * 1000), 'millisekond')
o2 = open('m3_shuffle.txt')
s = []
for i in o2:
    s.append(int(i))
nach = time.time()
s = spisok(s)
kon = time.time()
print('m3_shuffle.txt', round((kon - nach) * 1000), 'millisekond')
